package com.kaver.modular.system.dao;

import com.kaver.modular.system.model.DcConfigVersion;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.mapper.BaseMapper;

/**
 * <p>
 * 配置版本 Mapper 接口
 * </p>
 *
 * @author Roc
 * @since 2019-01-30
 */
public interface DcConfigVersionMapper extends BaseMapper<DcConfigVersion> {
	@Select("select max(version) from dc_config_version where app_id=#{appId} and env_id = #{envId}")
	Long maxVersion(@Param("appId")Integer appId, @Param("envId")Integer envId);
	@Select("select min(version) from dc_config_version where app_id=#{appId} and env_id= #{envId} and version > #{version}")
	Long minVersion(@Param("appId")Integer appId, @Param("envId")Integer envId, @Param("version")Long version);
}
